package leetcode_2301_2400;

import java.util.HashSet;
import java.util.Set;

public class LeeCode_2395 {
    public static void main(String[] args) {
        System.out.println(findSubarrays(new int[]{4, 2, 4}));
        System.out.println(findSubarrays(new int[]{1,2,3,4,5}));
        System.out.println(findSubarrays(new int[]{0,0,0}));
    }
    private static boolean findSubarrays(int[] nums){
        Set<Integer> set = new HashSet<>();
        for (int i = 0; i < nums.length - 1; i++) {
            int sum = nums[i] + nums[i + 1];
            if (set.contains(sum))
                return true;
            else
                set.add(sum);
        }
        return false;
    }
}
